<include file="Public:header" />
<!-- MAIN CONTENT start -->
<literal>
    <style>
        .table th, .table td {
            text-align: center;
            /*height:38px;*/
        }

    </style>
</literal>
<div class="span12">
    <div class="well blank-slate">
        <!--<h3>Problem List</h3>-->
        <form class="form-search">
            <label for="problem_id">问题编号：</label>
            <input class="input-medium" type="text" name="problem_id" placeholder="多个题目编号逗号隔开" value="{$problem_id}"/>
            <label for="user_id">用户：</label><input class="input-medium" type="text"  name="user_id"placeholder="学号" value="{$user_id}"/>
            <label for="language">语言：</label>
            <select class="input-medium" name="language">
                <option value="-1" <if condition="$language === -1 ">selected</if>>全部</option>
                <foreach name="lang_list" item="v_lang">
                    <option value="{$v_lang.value}" <if condition=" $language === $v_lang.value ">selected</if>>{$v_lang.name}</option>
                </foreach>
            </select>
            <label for="result">结果：</label>
            <select class="input-medium" name="result">
                <option value="-1" <if condition="$result === -1 ">selected</if>>全部</option>
                <foreach name="result_list" item="v_result">
                    <option value="{$v_result.value}" <if condition=" $result === $v_result.value ">selected</if>>{$v_result.name}</option>
                </foreach>
            </select>
            <button type="submit" class="btn">
                <i class="icon-search"></i>Go!
            </button>
        </form>
        <table class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th>运行编号</th>
                <th>用户</th>
                <th>题目编号</th>
                <th>结果</th>
                <th>内存</th>
                <th>耗时</th>
                <th>语言</th>
                <th>代码长度</th>
                <th>提交时间</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="v">
                <tr>
                    <td>
                        {$v.solution_id}
                    </td>
                    <td>
                        <a href="{:U('User/index',array('id'=>$v['user_id']))}">{$v.user_id}</a>
                    </td>
                    <td>
                        <a href="{:U('Problem/viewProblem',array('id'=>$v['problem_id']))}">{$v.problem_id}</a>
                    </td>
                    <td >
                        <foreach name="result_list" item="r_v">
                            <if condition="$v.result == $r_v.value ">
                                <if condition="$tag_style[$r_v['value']] eq '' ">
                                    <span class="label label-primary">{$r_v.name}</span>
                                    <img src="/img/loader.gif"/>
                                <else/>
                                    <span class="label {$tag_style[$r_v['value']]}">{$r_v.name}</span>
                                </if>

                                <!--&lt;!&ndash;<button class="result_{$r_v.value}">{$r_v.name}</button>&ndash;&gt;-->
                                <!--<if condition="0===$r_v.value or 1===$r_v.value or 2===$r_v.value or 3===$r_v.value "><img src="/images/loader.gif"/></if>-->
                            </if>
                        </foreach>
                    </td >
                    <td>
                        {$v.memory}&nbsp;Kb
                    </td>
                    <td>
                        {$v.time}&nbsp;ms
                    </td>
                    <td>
                        <foreach name="lang_list" item="l_v">
                            <if condition="$v.language == $l_v.value ">{$l_v.name}</if>
                        </foreach>
                    </td>
                    <td>
                        {$v.code_length}B
                    </td>
                    <td>
                        {$v.in_date}
                    </td>
                </tr>
            </foreach>
            <tr>
                <td colspan="9" align="center"> {$page}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<!-- MAIN CONTENT end-->
<include file="Public:footer" />